package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysDictionaryMapper;
import com.ruoyi.system.domain.SysDictionary;
import com.ruoyi.system.service.ISysDictionaryService;

/**
 * 系统数据字典Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-24
 */
@Service
public class SysDictionaryServiceImpl implements ISysDictionaryService 
{
    @Autowired
    private SysDictionaryMapper sysDictionaryMapper;

    /**
     * 查询系统数据字典
     * 
     * @param id 系统数据字典主键
     * @return 系统数据字典
     */
    @Override
    public SysDictionary selectSysDictionaryById(String id)
    {
        return sysDictionaryMapper.selectSysDictionaryById(id);
    }

    /**
     * 查询系统数据字典列表
     * 
     * @param sysDictionary 系统数据字典
     * @return 系统数据字典
     */
    @Override
    public List<SysDictionary> selectSysDictionaryList(SysDictionary sysDictionary)
    {
        return sysDictionaryMapper.selectSysDictionaryList(sysDictionary);
    }

    /**
     * 新增系统数据字典
     * 
     * @param sysDictionary 系统数据字典
     * @return 结果
     */
    @Override
    public int insertSysDictionary(SysDictionary sysDictionary)
    {
        sysDictionary.setCreateTime(DateUtils.getNowDate());
        return sysDictionaryMapper.insertSysDictionary(sysDictionary);
    }

    /**
     * 修改系统数据字典
     * 
     * @param sysDictionary 系统数据字典
     * @return 结果
     */
    @Override
    public int updateSysDictionary(SysDictionary sysDictionary)
    {
        sysDictionary.setUpdateTime(DateUtils.getNowDate());
        return sysDictionaryMapper.updateSysDictionary(sysDictionary);
    }

    /**
     * 批量删除系统数据字典
     * 
     * @param ids 需要删除的系统数据字典主键
     * @return 结果
     */
    @Override
    public int deleteSysDictionaryByIds(String[] ids)
    {
        return sysDictionaryMapper.deleteSysDictionaryByIds(ids);
    }

    /**
     * 删除系统数据字典信息
     * 
     * @param id 系统数据字典主键
     * @return 结果
     */
    @Override
    public int deleteSysDictionaryById(String id)
    {
        return sysDictionaryMapper.deleteSysDictionaryById(id);
    }
}
